<%@page import="models.config.SiteConfigModel"%>
<%@page import="models.OwnerDomainModel"%>
<%@page import="models.UserModel"%>
<%@page import="java.util.TreeMap"%>
<%@page import="helpers.UrlHelper"%>
<%@page import="java.util.ArrayList"%>
<%
	TreeMap check = (TreeMap) request.getAttribute("check");
	String success = (String) request.getAttribute("success");
	SiteConfigModel siteConfig = (SiteConfigModel) request.getAttribute("config");
	String image = UrlHelper.getServerUrl(request) + "/blobstore-serve?blob-key=" + siteConfig.getLogo();
	OwnerDomainModel ownerDomain = (OwnerDomainModel) request.getAttribute("ownerDomain");
	String type = (String) request.getAttribute("type");
%>


<jsp:include page="/layouts/demo/header.jsp">
    <jsp:param name="title" value="<%=siteConfig.getTitle()%>" />
    <jsp:param name="description" value="<%=siteConfig.getMetaDescription()%>" />
    <jsp:param name="keywords" value="<%=siteConfig.getMetaKeywords()%>" />
    <jsp:param name="ogsite_name" value="<%=siteConfig.getSiteName()%>" />
    <jsp:param name="ogtitle" value="<%=siteConfig.getTitle()%>" />
    <jsp:param name="ogurl" value="<%=UrlHelper.getServerUrl(request)%>" />
    <jsp:param name="ogimage" value="<%=image %>" />
    <jsp:param name="ogdescription" value="<%=siteConfig.getMetaDescription()%>" />
</jsp:include>

		<div class="dir">
			<a href="/home">Home</a> >  <a href="/profile/view" >Profile view</a> > <%=ownerDomain.getDomain() %>
		</div>
		<br />
		<div class="submit-form">
			<form action="" method="post">
			<table width="100%" cellpadding="0" cellspacing="0">
				<thead>
					<tr>
						<td colspan="2"><div class="title-form">Update</div></td>
					</tr>
				</thead>
				<tbody>
					<% if (type.equalsIgnoreCase("title")) { %>
					<tr>
						<td width="30%" class="domain">
							Title
						</td>
						<td>
							<input type="text" name="title" value="<%=ownerDomain.getTitle() != null? ownerDomain.getTitle() : "" %>" />
							<% if (check.get("title") != null)  { %>
								<div class="error"><%=check.get("title")%></div>
							<% } %>
						</td>
					</tr>
					<% } %>
					<% if (type.equalsIgnoreCase("description")) { %>
					<tr>
						<td width="30%" class="domain">
							Description
						</td>
						<td>
							<textarea rows="3" cols="80" name="description"><%=ownerDomain.getDescription() != null ? ownerDomain.getDescription() : "" %></textarea>
							<% if (check.get("description") != null)  { %>
								<div class="error"><%=check.get("description")%></div>
							<% } %>
						</td>
					</tr>
					<% } %>
					<% if (type.equalsIgnoreCase("status")) { %>
					<tr>
						<td width="30%" class="domain">
							Status
						</td>
						<td>
							<h3 style="color: green;"><input type="radio" value="1" name="active" <%=ownerDomain.getActive() == 1 ? "checked=\"checked\"" : "" %> > Active</h3>
							<div style="margin-bottom: 10px;" class="pro_value">The page <%=ownerDomain.getDomain() %> is active and visible at the URL. SEO data  gathering and backlinks stats updated regularly. </div>
							<h3><input type="radio" value="0" name="active" <%=ownerDomain.getActive() == 0 ? "checked=\"checked\"" : "" %>> Hidden</h3>
							<div style="margin-bottom: 10px;" class="pro_value">
								  The page Websiteus.org is visible only for you when you are logged 
								in. All the rest catch an Error 404 at the <a href="/info/<%=ownerDomain.getDomain()%>"><%=UrlHelper.getServerUrl(request) %>/info/<%=ownerDomain.getDomain() %>/</a>. As robots receive an Error 
								404 the links from this page are not visible and you do not receive link 
								weight to your pages. But, SEO data gathering and backlinks stats updated 
								regularly.
							</div>
							<% if (check.get("status") != null)  { %>
								<div class="error"><%=check.get("status")%></div>
							<% } %>
						</td>
					</tr>
					<% } %>
				</tbody>
				<tfoot>
					<tr>
						<td></td>
						<td>
							<button type="submit">Update</button>
						</td>
					</tr>
				</tfoot>
			</table>
			</form>
		</div>
<jsp:include page="/layouts/demo/footer.jsp">
    <jsp:param name="language" value="1" />
</jsp:include>